﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2048Test
{
    class Program
    {
        static void Main(string[] args)
        {
            GameMainManager.Instance.DrawMap();
            GameMainManager.Instance.GenerateNumber();
            GameMainManager.Instance.GenerateNumber();
            GameMainManager.Instance.DrawMap();
            while(GameMainManager.Instance.IsChange || !GameMainManager.Instance.IsOver)
            {
                GetKeyDown();
            }
            Console.WriteLine("GameOver");
            Console.Read();
        }

        public static void GetKeyDown()
        {
            switch (Console.ReadLine())
            {
                case "w":
                    GameMainManager.Instance.Move(Direction.Up);
                    break;
                case "s":
                    GameMainManager.Instance.Move(Direction.Down);
                    break;
                case "a":
                    GameMainManager.Instance.Move(Direction.Left);
                    break;
                case "d":
                    GameMainManager.Instance.Move(Direction.Right);
                    break;
            }
        }
    }
}
